/*
 Navicat Premium Data Transfer

 Source Server         : local
 Source Server Type    : MySQL
 Source Server Version : 80026
 Source Host           : localhost:3306
 Source Schema         : phone

 Target Server Type    : MySQL
 Target Server Version : 80026
 File Encoding         : 65001

 Date: 01/12/2021 16:43:45
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for customer
-- ----------------------------
DROP TABLE IF EXISTS `customer`;
CREATE TABLE `customer` (
  `customer_id` int NOT NULL AUTO_INCREMENT,
  `customer_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `customer_account` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `customer_password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `is_admin` int DEFAULT '0',
  PRIMARY KEY (`customer_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of customer
-- ----------------------------
BEGIN;
INSERT INTO `customer` VALUES (1, '朱佳喜', '201904102000', '123', 1);
INSERT INTO `customer` VALUES (2, '李永琪', '201901101027', '123', 1);
INSERT INTO `customer` VALUES (3, '贾奥', '201904102050', '123', 0);
INSERT INTO `customer` VALUES (5, '于洋', '201904102068', '123', 0);
INSERT INTO `customer` VALUES (6, '周经纬', '201904102054', '123', 1);
INSERT INTO `customer` VALUES (7, '王冰冰', '201901101001', '123', 0);
INSERT INTO `customer` VALUES (8, '刘亦菲', '201901101002', '123', 0);
INSERT INTO `customer` VALUES (9, '赫敏', '201901101003', '123', 0);
INSERT INTO `customer` VALUES (10, '奥格列', '201901101004', '123', 0);
INSERT INTO `customer` VALUES (11, '谢尔盖', '201901101005', '123', 0);
INSERT INTO `customer` VALUES (12, '莱昂纳多', '201901101009', '123', 0);
INSERT INTO `customer` VALUES (13, '乔寿凯', '201901101010', '123', 0);
INSERT INTO `customer` VALUES (14, '王乐斌', '201901101011', '123', 0);
INSERT INTO `customer` VALUES (15, '卢胜元', '201901101012', '123', 0);
INSERT INTO `customer` VALUES (16, '李杰', '201901101013', '123', 0);
INSERT INTO `customer` VALUES (17, '1', '20190410', '1', 0);
INSERT INTO `customer` VALUES (18, '1', '222222222222', '2', 0);
COMMIT;

-- ----------------------------
-- Table structure for order
-- ----------------------------
DROP TABLE IF EXISTS `order`;
CREATE TABLE `order` (
  `order_id` int NOT NULL AUTO_INCREMENT,
  `customer_id` int DEFAULT NULL,
  `phone_id` int DEFAULT NULL,
  `order_state` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  PRIMARY KEY (`order_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of order
-- ----------------------------
BEGIN;
INSERT INTO `order` VALUES (1, 1, 5, '未付款');
INSERT INTO `order` VALUES (2, 2, 9, '未付款');
INSERT INTO `order` VALUES (3, 3, 9, '未付款');
INSERT INTO `order` VALUES (4, 3, 12, '未发货');
INSERT INTO `order` VALUES (5, 5, 9, '未发货');
INSERT INTO `order` VALUES (6, 1, 1, '未发货');
INSERT INTO `order` VALUES (7, 1, 2, '未发货');
INSERT INTO `order` VALUES (8, 1, 3, '未付款');
INSERT INTO `order` VALUES (9, 2, 4, '未付款');
INSERT INTO `order` VALUES (10, 2, 5, '已发货');
INSERT INTO `order` VALUES (12, 3, 7, '已发货');
INSERT INTO `order` VALUES (13, 3, 8, '未发货');
INSERT INTO `order` VALUES (14, 3, 9, '已发货');
INSERT INTO `order` VALUES (15, 6, 10, '未发货');
INSERT INTO `order` VALUES (16, 6, 11, '已发货');
INSERT INTO `order` VALUES (17, 6, 4, '未付款');
INSERT INTO `order` VALUES (18, 6, 3, '已发货');
INSERT INTO `order` VALUES (19, 5, 4, '未发货');
INSERT INTO `order` VALUES (20, 2, 7, '已到货');
INSERT INTO `order` VALUES (21, 2, 62, '未发货');
INSERT INTO `order` VALUES (22, 2, 19, '未发货');
COMMIT;

-- ----------------------------
-- Table structure for phone
-- ----------------------------
DROP TABLE IF EXISTS `phone`;
CREATE TABLE `phone` (
  `phone_id` int NOT NULL AUTO_INCREMENT,
  `phone_brand` varchar(255) DEFAULT NULL,
  `phone_series` varchar(255) DEFAULT NULL,
  `phone_type` varchar(255) DEFAULT NULL,
  `phone_size` varchar(255) DEFAULT NULL,
  `phone_soc` varchar(255) DEFAULT NULL,
  `phone_disk` varchar(255) DEFAULT NULL,
  `phone_pixel` varchar(255) DEFAULT NULL,
  `phone_weight` varchar(255) DEFAULT NULL,
  `phone_battery` varchar(255) DEFAULT NULL,
  `price` varchar(128) DEFAULT NULL,
  `src` varchar(1024) DEFAULT NULL,
  PRIMARY KEY (`phone_id`)
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
-- Records of phone
-- ----------------------------
BEGIN;
INSERT INTO `phone` VALUES (1, 'iPhone', 'iPhone13', 'iPhone13 Pro', '6.1', 'A15', '128', '428×926', '150g', '3512mAh', '3288', 'assets/apple/iphone (1).png');
INSERT INTO `phone` VALUES (3, 'iPhone', 'iPhone13', 'iPhone13 mini', '6.7', 'A15', '128', '414×736', '190g', '3227mAh', '3288', 'assets/apple/iphone13pro.jpeg');
INSERT INTO `phone` VALUES (4, 'iPhone', 'iPhone12', 'iPhone12 Pro Max', '6.1', 'A14', '64', '375×812', '180g', '3512mAh', '3288', 'assets/apple/iphone (3).png');
INSERT INTO `phone` VALUES (5, 'iPhone', 'iPhone12', 'iPhone12 Pro', '6.7', 'A14', '64', '390×844', '177g', '2548mAh', '3288', 'assets/apple/iphone (2).png');
INSERT INTO `phone` VALUES (6, 'iPhone', 'iPhone12', 'iPhone12', '6.1', 'A14', '64', '2436*1125', '148g', '2996mAh', '3288', 'assets/apple/iphone13pro.jpeg');
INSERT INTO `phone` VALUES (7, 'iPhone', 'iPhone12', 'iPhone12 mini', '6.7', 'A14', '64', '428×926', '150g', '3227mAh', '3288', 'assets/apple/iphone13pro.jpeg');
INSERT INTO `phone` VALUES (8, 'iPhone', 'iPhone11', 'iPhone11 Pro Max', '6.1', 'A13', '64', '414×736', '190g', '3512mAh', '3288', 'assets/apple/iphone13pro.jpeg');
INSERT INTO `phone` VALUES (9, 'iPhone', 'iPhone11', 'iPhone11 Pro', '6.7', 'A13', '64', '375×812', '180g', '2548mAh', '3288', 'assets/apple/iphone13pro.jpeg');
INSERT INTO `phone` VALUES (10, 'iPhone', 'iPhone11', 'iPhone11', '6.1', 'A13', '64', '390×844', '177g', '2996mAh', '3288', 'assets/apple/iphone13pro.jpeg');
INSERT INTO `phone` VALUES (11, 'HUAWEI', 'Mate', 'HUAWEI Mate 40 Pro+', '6.7', 'Mate 40 Pro+', '128', '2436*1125', '148g', '3227mAh', '3288', 'assets/huawei/nova9Pro.png');
INSERT INTO `phone` VALUES (12, 'HUAWEI', 'Mate', 'HUAWEI Mate 40 Pro', '6.1', 'Mate 40 Pro+', '128', '428×926', '150g', '2548mAh', '3288', 'assets/huawei/HUAWEI P50.png');
INSERT INTO `phone` VALUES (13, 'HUAWEI', 'Mate', 'HUAWEI Mate 40', '6.7', 'Mate 40 Pro+', '128', '414×736', '190g', '3512mAh', '3288', 'assets/huawei/HUAWEI Mate 40 Pro+.png');
INSERT INTO `phone` VALUES (14, 'HUAWEI', 'Mate', 'HUAWEI Mate 40E', '6.1', 'Mate 40 Pro+', '64', '375×812', '180g', '2996mAh', '3288', 'assets/huawei/mate50.png');
INSERT INTO `phone` VALUES (15, '小米', '数字', 'Xiaomi 11 Ultra', '6.7', 'Mate 40 Pro+', '64', '390×844', '177g', '3227mAh', '3288', 'assets/xiaomi/Xiaomi Civi.png');
INSERT INTO `phone` VALUES (16, '小米', '数字', 'Xiaomi 11 Pro', '6.1', 'Mate 40 Pro+', '64', '390×844', '148g', '2548mAh', '3288', 'assets/xiaomi/Redmi Note 11 Pro.png');
INSERT INTO `phone` VALUES (17, '小米', '数字', 'Xiaomi 11 青春版', '6.7', 'Mate 40 Pro+', '128', '390×844', '150g', '3512mAh', '3288', 'assets/xiaomi/Xiaomi MIX 4.png');
INSERT INTO `phone` VALUES (18, '小米', '数字', 'Xiaomi 11', '6.7', 'A15', '64', '2436*1125', '190g', '2548mAh', '3288', 'assets/xiaomi/xiaomi1.png');
INSERT INTO `phone` VALUES (19, 'iPhone', 'iPhone13', 'iPhone13', '6.1', 'A15', '128', '390×844', '180g', '3227mAh', '3288', 'assets/apple/iphone (2).png');
INSERT INTO `phone` VALUES (38, 'iPhone', 'iPhone13', 'iPhone13 Pro Max', '6.7', 'A15', '128', '2436*1125', '148g', '3512mAh', '3288', 'assets/apple/iphone (3).png');
INSERT INTO `phone` VALUES (57, 'Samsung', 'Galaxy', 'Galaxy S21 5G', '6.7', 'Galaxy', '128', '2436*1125', '177g', '3227mAh', '3899', 'assets/sanxing/sanxing (1).png');
INSERT INTO `phone` VALUES (58, 'Samsung', 'Galaxy', 'Galaxy S21 5G MAX', '6.7', 'Galaxy', '128', '2436*1125', '177g', '3227mAh', '3899', 'assets/sanxing/Sanxing.png');
INSERT INTO `phone` VALUES (59, 'Samsung', 'Galaxy', 'Galaxy S21 5G Pro +', '6.7', 'Galaxy', '128', '2436*1125', '177g', '3227mAh', '3899', 'assets/sanxing/sanxing (2).png');
INSERT INTO `phone` VALUES (60, 'Samsung', 'Galaxy', 'Galaxy S21 5G 青春版', '6.7', 'Galaxy', '128', '2436*1125', '177g', '3227mAh', '3899', 'assets/sanxing/sanxing (3).png');
INSERT INTO `phone` VALUES (61, 'Vivo', 'Vivo X70', 'Vivo X70 Pro+', '6.1', 'Vivo X70 Pro+', '128', '428×926', '190g', '2548mAh', '3288', 'assets/vivo/vivo (3).png');
INSERT INTO `phone` VALUES (62, 'Oppo', 'Oppo Reno7', 'OPPO Reno7 8G+128G 星雨心愿', '6.1', 'OPPO Reno7 8G+128G 星雨心愿', '128', '2436*1125', '148g', '3512mAh', '3288', 'assets/sanxing/Sanxing.png');
INSERT INTO `phone` VALUES (63, 'Vivo', 'Vivo X70', 'Vivo X70', '6.7', 'Mate 40 Pro+', '64', '390×844', '150g', '3227mAh', '3288', 'assets/vivo/vivo (2).png');
INSERT INTO `phone` VALUES (64, 'Vivo', 'Vivo X70', 'Vivo X70 MAX', '6.7', 'Mate 40 Pro+', '64', '390×844', '150g', '3227mAh', '3288', 'assets/vivo/vivo (1).png');
INSERT INTO `phone` VALUES (65, 'Vivo', 'Vivo X70', 'Vivo X70 Pro +', '6.7', 'Mate 40 Pro+', '64', '390×844', '150g', '3227mAh', '3288', 'assets/vivo/vivo.png');
INSERT INTO `phone` VALUES (66, 'Oppo', 'Oppo Reno7', 'OPPO Reno7 8G+128G', '6.1', 'Galaxy', '128', '428×926', '190g', '3227mAh', '3288', 'assets/oppo/oppo (1).png');
INSERT INTO `phone` VALUES (67, 'Oppo', 'Oppo Reno7', 'OPPO Reno7 8G+128G MAX', '6.1', 'Galaxy', '128', '428×926', '190g', '3227mAh', '3288', 'assets/oppo/oppo (2).png');
INSERT INTO `phone` VALUES (68, 'Oppo', 'Oppo Reno7', 'OPPO Reno7 8G+128G Pro+', '6.1', 'Galaxy', '128', '428×926', '190g', '3227mAh', '3288', 'assets/oppo/oppo (3).png');
COMMIT;

-- ----------------------------
-- View structure for 2
-- ----------------------------
DROP VIEW IF EXISTS `2`;
CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `2` AS select `order`.`order_id` AS `order_id`,`customer`.`customer_id` AS `customer_id`,`customer`.`customer_name` AS `customer_name`,`phone`.`phone_type` AS `phone_type`,`order`.`order_state` AS `order_state` from ((`order` join `customer`) join `phone`) where ((`order`.`customer_id` = `customer`.`customer_id`) and (`order`.`phone_id` = `phone`.`phone_id`));

SET FOREIGN_KEY_CHECKS = 1;
